<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>消息管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			$("#checkAll").click(function () {
				$("input[name='id']:checkbox").prop("checked", this.checked);            
			});
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/news/news/list">消息列表</a></li>
		<shiro:hasPermission name="news:news:save"><li><a href="${ctx}/news/news/openSave">消息添加</a></li></shiro:hasPermission>
	</ul>
	<form:form id="searchForm" modelAttribute="news" action="${ctx}/news/news/list" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<ul class="ul-form">
			<li><label>是否已读：</label>
				<form:select path="seeState" class="input-medium">
					<form:option value="" label=""/>
					<form:options items="${fns:getDictList('seeState')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
			</li>
			<li class="btns">
				<a id="btnSubmit" class="btn btn-primary" onclick="return page();"><i class="icon-search"></i>&nbsp;查询</a>
			</li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th><input type="checkbox" id="checkAll"/></th>
				<th>接收用户</th>
				<th>是否已读</th>
				<th>阅读时间</th>
				<th>标题</th>
				<th>内容</th>
				<th>消息类型</th>
				<th>录入时间</th>
			</tr>
		</thead>
		<tbody>
		<c:choose>
			<c:when test="${not empty page.list}">
				<c:forEach items="${page.list}" var="news">
					<tr>
						<td><input class="checkbox-hook" type="checkbox" name="id" value="${news.id}"/></td>
						<td>
							${news.acceptUserName}
						</td>
						<td>
							${fns:getDictLabel(news.seeState, 'seeState', '')}
						</td>
						<td>
							<fmt:formatDate value="${news.seeDateTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
						</td>
						<td>
							${news.title}
						</td>
						<td>
							${news.count}
						</td>
						<td>
							${fns:getDictLabel(news.seeType, 'seeType', '')}
						</td>
						<td>
							<fmt:formatDate value="${news.createDate}" pattern="yyyy-MM-dd"/>
						</td>
					</tr>
				</c:forEach>
			</c:when>
			<c:otherwise>
				<tr>
					<td colspan="9" style="text-align: center;font-size:17px; font-family:SimHei">未查询到数据...</td>
				</tr>
			</c:otherwise>
			</c:choose>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>